<?php 
	$this->title = 'Page dacceuil';
	$this->headTitle($this->title);
?>
<h1>Liste des gagnants</h1>

<form action="" method="post" style="width: 600px;">
<a href="#">Export CSV</a>
<table class="table table-striped"   >
<thead><?php
 
		// Render each the title of each post for the current page in a list-item
	$date = new Zend_Date();
	$listgagnants="";
	 
	foreach ($this->paginator as $item) {		   
		foreach ($item as $key => $value){?>
		<?php if(isset($this->headercolums[$key])){?>
			 <th><?php echo  $this->headercolums[$key];  ?> </th>
			<?php } }?>
		
			<?php break;  }?>		
		</thead><tbody>
	
	<?php foreach ($this->paginator as $item) {	?>
		<tr>
		
		<?php  foreach ($item as $key => $value){?>
					<?php if(isset($this->headercolums[$key])){?>
					
					<td><?php echo $value?></td>
		<?php }
		?>
		
		
		<?php } if(isset($item["idgagnants"]) && !empty($item["idgagnants"])){ ?>	
		
			<td> <a href="<?php echo $this->url(array("action"=>"supprimerganant","module"=>"sondage","controller"=>"gsondage","id"=>$item["idgagnants"],"idsondage"=>$this->idsondage));?>">Supprimer</a></td>
		<?php }else{
		$listgagnants.=(empty($listgagnants)) ? $item['idparticipation'] : "_".$item['idparticipation']; 
		}

		?>	
			</tr>
		<?php }  ?>	
		
		<tr>
		
		</tr>
		</tbody></table>
		
			<input type="hidden" name="gagnants" id="gagnants" value="<?php echo $listgagnants?>"/>
			<input type="submit" value="Enregistrer" >
	
</form>
<br/>
<?php // echo $this->paginator; ?>